--other=add unit test for polaris routing module#44
Open
smartboyjia wants to merge 6 commits intotrpc-group:masterfrom
Open
--other=add unit test for polaris routing module#44smartboyjia wants to merge 6 commits intotrpc-group:masterfrom
smartboyjia wants to merge 6 commits intotrpc-group:masterfrom
Conversation
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
liuzengh
added a commit
to trpc-group/cla-database
that referenced
this pull request
Jun 11, 2024
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #44 +/- ##
=====================================================
+ Coverage 69.41646% 69.62508% +0.20861%
- Complexity 4125 4139 +14
=====================================================
Files 428 428
Lines 16777 16777
Branches 1698 1698
=====================================================
+ Hits 11646 11681 +35
+ Misses 4030 4000 -30
+ Partials 1101 1096 -5 |
| import java.util.List; | ||
| import java.util.Map; | ||
|
|
||
| import java.util.*; |
| try { | ||
| clusterNaming.warmup(serviceId); | ||
| } catch (Exception e) { | ||
| return; |
Collaborator
There was a problem hiding this comment.
可以再这里断言一下,如果是测试异常情况,其他地方也是
| } | ||
|
|
||
| @Test | ||
| public void testExceptionAsyncSelectAll() { |
| request.getMeta().setHashVal("123333"); | ||
| CompletionStage<ServiceInstance> future = clusterNaming.asyncSelectOne(serviceId, request); | ||
| AtomicReference<Throwable> errorRef = new AtomicReference<>(); | ||
| CompletionStage<ServiceInstance> stage = future.whenComplete((res, err) -> { |
Collaborator
There was a problem hiding this comment.
能正常获取到实例,就没有异常吧,也可以判断一下ServiceInstance
| when(instance.isHealthy()).thenReturn(true); | ||
| when(instance.getRevision()).thenReturn("1.0.0"); | ||
| Map<String, String> metadata = new HashMap<>(); | ||
| metadata.put("set", "set.sz.1"); |
| try { | ||
| PolarisTrans.parseRouterResult(null,null); | ||
| } catch (Exception e) { | ||
| return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
unit test add